#ifndef _COMPONENTANIMATIONS_H_
#define _COMPONENTANIMATIONS_H_

#include "TimedAnimation.h"

/** These are some example animations targetted at Components */

namespace CompAnims	
{

	//---------------------------------
	class Move	:	public LinearXYAnimation,
					public ComponentDeletionWatcher
	{
	public:
		Move (Component* c, int x1, int y1, int x2, int y2, int durationMs);
		~Move ();

		void applyUpdateToTarget (int x, int y);

	private:
	};

	//---------------------------------
	class Size	:	public LinearXYAnimation,
					public ComponentDeletionWatcher
	{
	public:
		Size (Component* c, int w1, int h1, int w2, int h2, int durationMs);
		~Size ();

		void applyUpdateToTarget (int x, int y);

	private:
	};

	//---------------------------------
	class DoubleProperty	:	public LinearDoubleAnimation,
									public ComponentDeletionWatcher
	{
	public:
		DoubleProperty (Component* c, const String& propName, const double start, const double end, int durationMs);
		~DoubleProperty ();

		void applyUpdateToTarget (double value);

	private:
		String propertyName;
	};

	//---------------------------------
	class ColourChange	:	public LinearColourAnimation,
							public ComponentDeletionWatcher
	{
	public:

		ColourChange (Component* c, int colourId, const Colour& c1, const Colour& c2, int durationMs);
		~ColourChange ();

		void applyUpdateToTarget (const Colour& c);

	private:
		int id;
	};

};

class SuperComponentAnimator	:	public Animator
{
public:

	SuperComponentAnimator ();
	~SuperComponentAnimator ();

	void changeColour (Component* c, int colourId, const Colour& newColour, int durationMs, bool loop=false, bool pingPong=false, int numTimes=0);
	void changeDoubleProperty (Component* c, const String& propName, double targetValue, int durationMs, bool loop=false, bool pingPong=false, int numTimes=0);
	void changePosition (Component* componentToMove, int targetX, int targetY, int durationMs, bool loop=false, bool pingPong=false, int numTimes=0);
	void changeSize (Component* componentToResize, int targetX, int targetY, int durationMs,bool loop=false, bool pingPong=false, int numTimes=0);

	void frameFinished (void* target);

private:
};



#endif//_COMPONENTANIMATIONS_H_
